package com.halixun.d2app.utils;

import android.annotation.SuppressLint;
import android.content.Context;

import java.util.HashMap;
import java.util.Map;

/**
 * @ProjectName: D2App
 * @Package: com.halixun.d2app.utils
 * @ClassName: RequestDataUtils
 * @Description: java类作用描述
 * @Author: hdx
 * @CreateDate: 2019/12/12 14:04
 * @UpdateUser: hdx
 * @UpdateDate: 2019/12/12 14:04
 * @UpdateRemark: 更新说明：
 * @Version: 1.0
 */
public class RequestDataUtils {

    public static Map<String, String> requestParam;

    @SuppressLint("NewApi")
    public static Map<String, String> getRequestDataParam(Context context) {
        if (requestParam == null) {
            requestParam = new HashMap<>();
        }
        if (!requestParam.containsKey("DeviceId") || !requestParam.containsKey("PosVersion") || requestParam.containsKey("Version")) {
            requestParam.put("DeviceId", SystemUtil.getIMEI(context));
            requestParam.put("PosVersion", SystemUtil.getDeviceBrand() + "." + SystemUtil.getSystemModel());
            requestParam.put("Version", VersionUtil.getAppVersionName(context));
        }
        return requestParam;
    }
}
